<div id="search-contacts-screen">

<form name="form1" method="get" action="%%[base_url]%%/addressbook.php">

<h2>Search | Browse Contacts</h2>

<div id="search-filters">

    <table cellspacing="0" summary="">
    
        <tr>
        
            <td><label>First Name</label><input class="input160" type="text" name=first_name value="%%[first_name]%%" tabindex="1" /></td>
            <td><label>Last | Org. Name</label><input class="input160" type="text" name=last_name value="%%[last_name]%%" tabindex="1" /></td>
        	<td><label>SSN</label><input class="input100" type="text" name="ssn" onkeyup="pika_ssn(this);" value="%%[ssn]%%" maxlength="11" tabindex="1" /></td>
        	<td><label>Phone</label><input class="input30" type="text" name="area_code" value="%%[area_code]%%" onkeyup="pika_area_code(this, 3, 'phone');" maxlength="3" tabindex="1" /> <input class="input80" type="text" name="phone" value="%%[phone]%%" onkeyup="pika_phone(this);" maxlength="8" tabindex="1" /></td>
        
        </tr>

    </table>

</div> <!-- /#search-filters -->    

<input type="hidden" name="order_field" value="%%[order_field]%%"/>
<input type="hidden" name="order" value="%%[order]%%"/>
<input type="hidden" name="offset" value="%%[offset]%%"/>

<ul id="prospective-submit">
<li><input type="submit" name="dmodes" value="Search Contacts" tabindex="1" /></li>
<li><input type="submit" name="dmodeb" value="Browse Contacts" tabindex="1" /></li>
</ul>

</form>

%%[search_list]%%

%%[ab_list]%%

%%[begin:flex_header]%%

<table cellspacing="0" summary="">

    <tbody>
	
    <tr>

		<th class="first">Name</th>
		<th>Phone</th>
		<th>Alt. #</th>
		<th>Address</th>
		<th>City</th>
		<th>DOB</th>
		<th class="last">SSN</th>

	</tr>

%%[end:flex_header]%%

%%[begin:flex_row]%%

    <tr class="row%%[row_class]%%">
    
        <td>
		<a href="%%[base_url]%%/contact.php?contact_id=%%[contact_id]%%">%%[client_name]%%</a>
        </td>
        
        <td>
        %%[client_phone]%% %%[area_code]%% %%[phone]%%
        </td>
        
        <td>
        %%[client_phone_alt]%% %%[phone_notes_alt]%%
        </td>
        
        <td>
        %%[address]%%
        </td>
        
        <td>
        %%[city]%%
        </td>
        
        <td>
        %%[birth_date]%%
        </td>
        
        <td>
        %%[ssn]%%
        </td>

    </tr>

%%[end:flex_row]%%

%%[begin:flex_footer]%%

    </tbody>

</table>

%%[end:flex_footer]%%

</div> <!-- #search-contacts-screen -->

<script language="JavaScript" type="text/javascript"><!--
var old_ssn_length = 0;

function pika_ssn(what)
{
	if (what.value.length == 3 && old_ssn_length == 2)
	{
		what.value += '-';
	}

	if (what.value.length == 6 && old_ssn_length == 5)
	{
		what.value += '-';
	}

	old_ssn_length = what.value.length;
}

var ac_autotab_on = 1;

function pika_area_code(what, max, field_name)
{	
	if (max > 0 && what.value.length >= max && ac_autotab_on == 1)
	{
		eval('document.form1.' + field_name + '.focus()');
	}

	if (what.value.length >= 3)
	{
		ac_autotab_on = 0;
	}

	else if (what.value.length == 0)
	{
		ac_autotab_on = 1;
	}

	return;
}

var old_phone_length = 0;

function pika_phone(what)
{
	if (what.value.length == 3 && old_phone_length == 2)
	{
		what.value += '-';
	}

	old_phone_length = what.value.length;
}

document.form1.first_name.focus();

//--></script>
